<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateArticleTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('article', function (Blueprint $table) {
            $table->increments('id');
            $table->integer("category_id")->default(0)->comment("分类ID");
            $table->tinyInteger("type")->default(0)->comment("类型 1资讯 2帮助中心 3通知");
            $table->string("title",150)->default('')->comment("标题");
            $table->string("description",255)->default('')->comment("描述");
            $table->string("thumb",150)->default('')->comment("缩略图");
            $table->text("content")->default('')->comment("文章内容");
            $table->tinyInteger("is_top")->default(0)->comment("是否置顶 0否 1是");
            $table->tinyInteger("is_best")->default(0)->comment("是否是精品；0，否；1，是 ");
            $table->smallInteger("click_num")->default(0)->comment("浏览量");
            $table->smallInteger("sort")->default(50)->comment("排序 从小到大");
            $table->tinyInteger("is_deleted")->defailt(0)->comment("是否删除 0否 1是");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('article');
    }
}
